#include "Card.h"

Card::Card(int suit, int rank){
	this->suit = (SUIT) suit;
	this->rank = (RANK) rank;
	visibility = true;
}

int Card::getPoints() const {
	if(rank > 1) {
		if(rank > 9)
			return 10;
		else 
			return rank;
	} else return 11;
}

std::string Card::getSuit() const {
	if(visibility) {
		std::string suits[4] = {"D", "H", "C", "S"};
		return suits[this->suit];
	} else
		return "X";
}

std::string Card::getRank() const {
	if(visibility) {
		std::string ranks[13] = {"A", "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K"};
		return ranks[this->rank - 1];
	} else
		return "X";
}

void Card::setVisibility(bool b) {
	visibility = b;
}

bool Card::isVisible() {
	return visibility;
}